package com.etoak.api;

import com.etoak.common.core.vo.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 远程调用接口
 */
@FeignClient("upload-service")
public interface UploadService {

    /**
     * 声明远程图片上传接口
     * 1. @PostMapping 必须提供consumes 属性, 它的值必须是multipart/form-data
     * 2. MultipartFile参数前必须增加@RequestPart
     */
    @PostMapping(value ="/upload/image", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultVO<String> upload(@RequestPart MultipartFile pic);
}
